package com.xiaowan.user.controller;

import com.xiaowan.model.user.Address;
import com.xiaowan.user.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 实现功能：地址
 *
 * @author 作者[admin]
 * @version 1.0.00 2023-04-07 15:46
 */
@RestController
@RequestMapping("/address")
public class AddressController {
    @Autowired
    private AddressService addressService;

    @GetMapping("/findByPid/{pid}")
    public List<Address> findByPid(@PathVariable("pid") Integer pid){
        return  addressService.findByPid(pid);

    }

    @GetMapping("/findById/{id}")
    public Address findById(@PathVariable("id") Integer id){
        return addressService.findById(id);
    }
}
